﻿using JTTD.Common.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace JTTD.DataBase.Model.Coupon
{
    /// <summary>
    /// 优惠券信息
    /// </summary>
    [Table("t_coupon_info")]
    public  class CouponInfoModel:BaseModel
    {
        /// <summary>
        /// 优惠券金额
        /// </summary>
        [Column("amount")]
        public decimal Amount { get; set; }
        /// <summary>
        /// 开始有效时间
        /// </summary>
        [Column("startTime")]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束有效时间
        /// </summary>
        [Column("endTime")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 兑换时间
        /// </summary>
        [Column("createTime")]
        public DateTime CreateTime { get;  set; } = DateTime.Now;

        /// <summary>
        /// 用户id
        /// </summary>
        [Column("userId")]
        public int UserId { get; set; }

       
        /// <summary>
        /// 是否使用
        /// </summary>
        [Column("isUse")]
        public bool IsUse { get; set; } = false;

        /// <summary>
        /// 优惠券来源
        /// </summary>
        [Column("source")]
        public CouponSourceEnum Source { get; set; } = CouponSourceEnum.IntegralExChange;

        /// <summary>
        /// 优惠券号
        /// </summary>
        [Column("couponNumber")]
        public string CouponNumber { get;  set; } = "No"+DateTime.Now.Ticks;
    }
}
